#define DEBUG
#include <cstdio>

using namespace std;

const int maxn=300;

int count(int f[][2*maxn+1], int x1, int y1, int x2, int y2) {
  return f[x2][y2]-f[x1-1][y2]-f[x2][y1-1]+f[x1-1][y1-1];
}

int main() {
  freopen("triangles.in", "r", stdin);
  freopen("triangles.out", "w", stdout);

  static bool map[maxn+1][maxn+1];
  int n;
  scanf("%d ", &n);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      map[i][j] = getchar()=='*';
    }
    getchar();
  }

  static int f[2*maxn+1][2*maxn+1];
  static bool mat[2*maxn+1][2*maxn+1];
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=n; j++) {
      f[i+j][i-j+n] = mat[i+j][i-j+n] = map[i][j];
    }
  }
  for (int i=1; i<=2*n; i++) {
    for (int j=1; j<=2*n; j++) {
      f[i][j] += f[i-1][j]+f[i][j-1]-f[i-1][j-1];
    }
  }

  int ans=0;
  for (int i=1; i<=2*n; i++) {
    for (int j=1; j<=2*n; j++) {
      if (mat[i][j]) {
        for (int k=1; k<=2*n; k++) {
          if (i+k<=2*n && mat[i+k][j]) {
            if (j+k<=2*n) {
              ans += count(f, i, j+k, i+k, j+k);
            }
            if (j-k>0) {
              ans += count(f, i, j-k, i+k, j-k);
            }
          }
          if (j+k<=2*n && mat[i][j+k]) {
            if (i+k<=2*n) {
              ans += count(f, i+k, j+1, i+k, j+k-1);
            }
            if (i-k>0) {
              ans += count(f, i-k, j+1, i-k, j+k-1);
            }
          }
        }
      }
    }
  }

  printf("%d", ans);

  fclose(stdin);
  fclose(stdout);
  return 0;
}
